export function queue(num: Array<any>) {
  let promise = Promise.resolve();
  num.map((v) => {
    promise = promise.then((_) => v());
  });
}

function p1() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log('sss1');
      resolve("s");
    }, 2000);
  });
}

function p2() {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      console.log('sss2');
      resolve("s");
    }, 1000);
  });
}
queue([p1,p2])
